package com.cn.zmc.design.chian.controller;


import com.cn.zmc.design.chian.domain.ChainDto;
import com.cn.zmc.design.chian.factory.ChainFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("chain")
@Configuration
@Component
public class ChainController {

    @Autowired
    private ChainFactory chainFactory;

    @RequestMapping("test/{id}")
    public String test(@PathVariable("id") long id) {
        chainFactory.getFactoryByType(id).execute(new ChainDto());
        return "ok";
    }


}
